import ucApi from "@rc/apis/uc/index.mjs";

export default [
    {
        type: "remoteSelect",
        label: "用户姓名",
        key: "teacherId",
        property: {
            placeholder: "请输入课件上传人姓名",
            clearable: true,
            options: [],
            props: {
                label: "label",
                value: "value"
            },
            remoteMethod(item, query) {
                if (StringUtil.hasLength(query)) {
                    ucApi.queryUserList({
                        data: { userName: query },
                        success: ({ data }) => {
                            item.options = data.map((i) => ({
                                label: i.userName + " - " + i.schoolName,
                                value: i.userId
                            }));
                        }
                    });
                } else {
                    item.options = [];
                }
            }
        }
    },
    {
        type: "input",
        label: "保利威邮箱",
        key: "uploadUserEmail",
        property: {
            placeholder: "请输入保利威账号邮箱"
        }
    }
];
